/**
 * 
 */
package chetan.ChildView;

import android.app.Activity;
import android.net.Uri;
import android.os.Bundle;
import android.util.Log;
import android.widget.VideoView;
import android.graphics.PixelFormat;
import android.widget.MediaController;
/**
 * @author ckalyan
 *
 */
public class VideoActivity extends Activity {
	public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        
        
        String path = "/sdcard";
        String fileName = "The_International.3gp";//"Avatar_Trailer_H264_10Mbps_BP_720P_AAC.MP4"
        boolean autoplay = true;
      //get current window information, and set format, set it up differently, if you need some special effects
        getWindow().setFormat(PixelFormat.TRANSLUCENT);
        //the VideoView will hold the video
        VideoView videoHolder = new VideoView(this);
        Log.d("VideoActivity","@@@zorder start@@@");
        videoHolder.setZOrderOnTop(true);
        Log.d("VideoActivity","@@@zorder end@@@");
        //MediaController is the ui control howering above the video (just like in the default youtube player).
        videoHolder.setMediaController(new MediaController(this));
        //assing a video file to the video holder
        videoHolder.setVideoURI(Uri.parse(path+"/"+fileName));
        //get focus, before playing the video.
        videoHolder.requestFocus();
        if(autoplay){
            videoHolder.start();
        }
        setContentView(videoHolder);
	}
}
